package inject

import (
	"gitee.com/kordar/bucket/service/impl"
	digstarter "github.com/kordar/dig-starter"
	"github.com/kordar/gocrud"
)

func ServiceProvider() {

	digstarter.ProvideE(func(db DatasetDB) (ServiceResult, error) {
		bucketServiceImpl := impl.NewBucketServiceImpl(db.DB)
		bucketUploaderServiceImpl := impl.NewBucketUploaderServiceImpl(bucketServiceImpl)
		return ServiceResult{
			BucketUploaderService: bucketUploaderServiceImpl,
			BucketService:         bucketServiceImpl,
			ResourceService: []gocrud.ResourceService{
				bucketServiceImpl,
			},
		}, nil
	})

}
